Mechanical Design and Machine Design

Group

Apoorv Vats

Amit Sharma

Puneeth Raj (Local Instructor)

Link for Group page

CNC Plotter

My Contribution in Group Assignment

To drive the 3-axes plotter we will be using Stepper motors. I was given the charge to look for controlling of motors.


Stepper Motor

NEMA 23

It has 200 steps to ne revolution (1.8 degree per step). It actually has 4 coils (which means it can be wired as both a bipolar and unipolar), but we join wires to turn it into a bipolar.



EasyDriver - Stepper Motor Driver

To drive the stepper motor we decided to use Easy Stepper Motor Driver.

Quick Pin Description:

Please see the Allego A3967 data sheet linked above for complete technical details. The Easy Driver is basically just a breakout board for this driver chip, so the datasheet is your best source of information about how it all works. However, if all you need is a reference to the pins, here you go:

GND : There are three GND (Ground) pins on the Easy Driver. They are all connected together inside the board. Connect the negative side of your power supply, as well as from any other boards you are using to drive the Easy Driver to one or more of the GND pins.

M+ : This is the power input to the Easy Driver. Connect this to the positive power supply lead. This should be a 6V to 30V, 2A (or more) power supply that is clean (low ripple).

A and B : (four pins) These are the motor connections. See below diagrams for how to hook these up. A and B are the two coils of the motor, and can swap the two wires for a given coil (it will just reverse the direction of the motor). Make CERTAIN that this connection to the motor is solid, and NOT through a connector that has any chance of intermittent contact (which will fry the motor driver chip).

STEP : This needs to be a 0V to 5V (or 0V to 3.3V if you've set your Easy Driver that way) digital signal. Each rising edge of this signal will cause one step (or microstep) to be taken.

DIR (Direction) : This needs to be a 0V to 5V (or 0V to 3.3V if you've set your Easy Driver up that way) digital signal. The level if this signal (high/low) is sampled on each rising edge of STEP to determine which direction to take the step (or microstep).

That's it - those are the only signals that you absolutely need to connect to anything. All the rest below are optional - in other words, the Easy Driver sets them to reasonable default values.

MS1/MS2 : These digital inputs control the microstepping mode. Possible settings are (MS1/MS2) : full step (0,0), half step (1,0), 1/4 step (0,1), and 1/8 step (1,1 : default).

RST (reset) : This normally high input signal will reset the internal translator and disable all output drivers when pulled low.

SLP (sleep) : This normally high input signal will minimize power consumption by disabling internal circuitry and the output drivers when pulled low.

ENABLE : This normally low input signal will disable all outputs when pulled high.

Description: The EasyDriver is a simple to use stepper motor driver, compatible with anything that can output a digital 0 to 5V pulse (or 0 to 3.3V pulse if you solder SJ2 closed on the EasyDriver). The EasyDriver requires a 6V to 30V supply to power the motor and can power any voltage of stepper motor. The EasyDriver has an on board voltage regulator for the digital interface that can be set to 5V or 3.3V. Connect a 4-wire stepper motor and a microcontroller and you’ve got precision motor control! EasyDriver drives bi-polar motors, and motors wired as bi-polar. I.e. 4,6, or 8 wire stepper motors.

Features:

A3967 Microstepping Driver

MS1 and MS2 pins broken out to change microstepping resolution to full, half, quarter and eighth steps (defaults to eighth).

Compatible with 4, 6, and 8 wire stepper motors of any voltage.

Adjustable current control from 150mA/phase to 700mA/phase.

Power supply range from 6V to 30V. The higher the voltage, the higher the torque at high speeds.


Note: Do not connect or disconnect a motor while the driver is energized. This will cause permanent damage to the A3967 IC.

Schematic and Board

I used Eagle 7.7.0 to make the schematic and board. In schematic three Easy Stepper Motor driver is used to drive three motors at X,Y and Z axes. To add pin layout for drivers in eagle the library is downloaded from here. All the drivers will recieve 12 V suplly from common terminal. For Step and Direction of each motor 6 Pin male header is mounted on the board. Below is the snapshot of the Schematic.


Board

While routing the board the mirror image of drivers is used as they need to be mounted on the bottom side of the board.


plotter.sch, plotter.brd



Milling the Board

For milling the board the toolpath is generated using the FabModules.



traces.png, interior.png, holes.png


Soldering the Stuff

The problem which i faced while soldering is collecting two pin, three pin female header. Below you can find the stuffed board.

Snapshot after mounting the Easy Stepeer motor Driver.



Software Installation

GRBL FIRMWARE

GRBL FIRMWARE is an open source, embedded, high performance g-code-parser and CNC milling controller written in optimized C that will run on a straight Arduino.

Grbl is a no-compromise, high performance, low cost alternative to parallel-port-based motion control for CNC milling. This version of Grbl runs on an Arduino Mega2560 only.

Download grbl firmware for Arduino Mega form here

The controller is written in highly optimized C utilizing every clever feature of the AVR-chips to achieve precise timing and asynchronous operation. It is able to maintain up to 30kHz of stable, jitter free control pulses. It accepts standards-compliant g-code and has been tested with the output of several CAM tools with no problems. Arcs, circles and helical motion are fully supported, as well as, all other primary g-code commands. Macro functions, variables, and most canned cycles are not supported, but we think GUIs can do a much better job at translating them into straight g-code anyhow. Grbl includes full acceleration management with look ahead. That means the controller will look up to 24 motions into the future and plan its velocities ahead to deliver smooth acceleration and jerk-free cornering.

To Know about GRBL version 1.1 click here here

Flashing GRBl frimware in Arduino Mega

First i followed the tutorail given below



Step 1: Download the grbl firmware given in the above link and unzip the given folder

Step 2: Now open the downloaded folder. Next step is to paste the grbl folder in the library folder of Arduino installed on your sytem.

Step 3:Now open the grbl folder on check the config.h

Verify that the firmware is fo Arduino Mega 2560

#define CPU_MAP_2560_INITIAL

Step 4: Open ArduinoIDE and connect Arduino Mega to the laptop using USB

Step 5: Next open the examples in ArduinoIDE then move to grbl and grbl upload

Step 6: Upload GRBl in the arduino Mega

Step 7: Next Step is to check the grbl firmware through serial communication.



Now grbl Firmware 1.1e is uploaded in Arduino Mega

To know Grbl's $x=val settings and what they mean click here



Universal G-code Sender (UGS)

To Download Universal G-code Center click here

First i downloaded stable build version 1.0.8. This version was not working with my board. Then to debug the problem i tried with diffrent system, used another Arduino Mega board, changed the cable. But still i was stuck with the problem. Then i switched to the higher version and it started working.

In the above downloaded folder open UniversalGcodeSender.jar file

Open the port with baudrate 115200

Use $$ command to check the firmware

Testing the Board

The default pin configuration for Arduino Mega 2560 is given below. I will recommend others to follow latest pin configuration as there are other configurations available. I suffered with the same problem. When i started working motor was not changing directio. It means my direction pnin was not working. To debug this i applied 5V and GND manually at the direction PIN. Now the motor start changing its direction. Later i got to know the pin configuration for arduino Mega2560 which was used was not latest.

After making all the connection i tested motors with stepper motor drivers.

Problem Faced

1. The mistake which is done by me that i cropped the outer image before making the toolpath. Then it shifted the orgin of external cut and my board got damaged while cutting the outer boundary. The conclusion drawn from this problem is we should take care of the pixels size while importing the image. We should see that the size of the images should not be altered while importing images from one software platform to another.

2. The default pin configuration available for Arduino Mega 2560 GRBL firmware is not updated.It uses the old pin configuratation. It is highly recommended to use the updated image or check the status in the file cpu_map.h available in grb folder. The updated image is shown below.

3. The major problem which i faced is with the diffrent version of Universal G-code Center (UGS). Initailly I was using UGS version 1.0.8 and it was accepting the port but not responding for any input. I thought the problem may be with the board or may be of connecting wires.I tried with different possible alternatives such as, i changed the board, changed the cable and it didn't worked. It took me hours to reach to the version problem. This GRBL firmware is not compatible with older versions of UGS. Then I switched to latest version of UniveralGcodeSenderv1.0.9 and finally it worked.

4.Ground Problem :While working with the board the motor was working correct when command was sent using the dekstop available in the LAB. But using my laptop motor was getting some noise signals. The operation was noisy and not folowing the input. When i discussed the problem with my local instructor he told me the problem may be because of ground port. To resolve the problem i connected the gnd signal of Arduino Mega 2560 and 12V supply. The noise signal was not present after this and motor startd to follow the input.

Machine Design

After discussing with my group we started working on machine design. Amit started making the 3D model of the mahine. Then we started to work on the assembly of the machine. Most of the parts required are available in our lab inventory.

There was some mistake in the size of machine bed to be fit on the guided path. So we decided to reduce the size using th tools availbale in carpentary shop.

Below is the snapshot of the while assembling the Y axis of the machine.

Improvements in the Design

(1) In this machine we are using only 2-axes,it can be further expanded to 3 axis machine.

(2) The plywood we used for designing is thin, so it is not giving the required rigidity. In future we can work to make this model more rigid.

(3)The end point on axes are not defined. We can make change in the program to fix the extreme points.